<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

//echo 'hello options.php'
//settings_fields( 'myoption-group' );
//function abee_dashboard(){

global $menu;
$menuicons = array();
$menuicons['edit_pages'] = 'pageIcon.png';
$menuicons['upload_files'] = 'mediaIcon.png';
$menuicons['edit_menu'] = 'menuIcon.png';
$menuicons['edit_widgets'] = 'widgetIcon.png';
$menuicons['abee_settings'] = 'widgetIcon.png';
$menuicons['abee_settingsMain'] = 'settingsIcon.png';
//print_r($menu);
?>
<div class="wrap">
    <div id="icon-options-general" class="icon32"><br></div>
    <h2>
        Kokpit
        <img src="<?=  bloginfo('template_url') . '/images/' . 'logo.png' ?>" style="margin: 0px auto;display: block;"/>
    </h2>
    
    <div class="clear"></div>
        <?php
        // 0 = name, 1 = capability, 2 = file, 3 = class, 4 = id, 5 = icon src
        foreach ($menu as $key => $item) {
            if (empty($item[0]) || $item[1] == 'dash')
                continue;
            
            //Checking if it's admin page
            if(false ===  strpos($item[2], '.php') || false !== strpos($item[2], 'abee/'))
                    $item[2] = 'admin.php?page='.$item[2];
            ?>
            <div class="abeeboxWrap">
                <a href="<?= $item[2] ?>">
                    <?php
                    $ikona = '';
                    if (!empty($item[1]) && isset($menuicons[$item[1]]))
                        $ikona = plugins_url('images/ico/' . $menuicons[$item[1]], __FILE__);
                    else
                        $ikona = plugins_url('images/ico/' . $menuicons['abee_settings'] , __FILE__);
                    ?>
                    <div class="abeebox" style="background-image: url('<?= $ikona ?>')">
                        <p><?= $item[0] ?></p>
                    </div>
                </a>
            </div>
            <?php
        }
        ?>

</div>
<?php
//}?>